<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Dokument</title>
         <script type="text/javascript">
         function testFormName(){
           document.f1.it1.value="Klik";  
           alert(document.lastModified);
           alert(document.title);
           alert("URL stranice: "+document.URL);
         }
         function novaStranica(){
             var tekst=document.f1.it1.value;
             document.open();
             document.write("<h1>Otvorio stranicu, vrijednost polja"+tekst+"<h1/>");
             document.close();
         }
        //alert(document.formna)
        
        function fokusPolja(){
            var polje= document.getElementById("it1");
            polje.style.color="Blue";
            polje.style.backgroundColor="Green";
            polje.focus();
        }
        
        function kreirajElement(){
            var forma=document.getElementById("f1");
            var polje = document.createElement("h1");
            var tekst=document.createTextNode("Dinamički element");
            polje.appendChild(tekst);            
            forma.appendChild(polje);            
        }
        </script>
    </head>
    <body>
        <form name="f1" id ="f1">
            <input name="it1" id="it1"/>
            <button type="button" onclick="testFormName()">
                Button
            </button>
            <button type="button" onclick="novaStranica()">
                CreateD
            </button>
            <button type="button" onclick="fokusPolja()">
                Fokus
            </button>
            <button type="button" onclick="kreirajElement()">
                Kreiraj element
            </button>
        </form>
       
    </body>
</html>